package com.guosifan.feign;

import com.guosifan.entity.Menu;
import com.guosifan.entity.Type;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient( value = "menu")
public interface MenuClientFeign {

    @GetMapping("/menu/findAll")
    public List<Menu> findAll(@RequestParam int page,@RequestParam int limit);

    @GetMapping("/menu/count")
    public int count();

    @GetMapping("/menu/deleteById/{id}")
    public int deleteById(@PathVariable int id);

    @GetMapping("/menu/findTypes")
    List<Type> findTypes();

    @PostMapping("/menu/save")
    int save(Menu menu);
}
